
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%--<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'createScale.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="css/listcss.css"rel="stylesheet" type="text/css"/>
  </head>
  
  <body> --%>
<form class="createScale form form-horizontal"action="./CreateNewScaleServlet" method="post">
	<legend>设置问卷基本信息 </legend>
	<div>
		<div class="row">
			<label class="form-label col-xs-4 col-sm-3">所属类型:</label>
			<div class="formControls col-xs-8 col-sm-9">
				<label class="form-label col-xs-4 col-sm-3">计算机软件工程</label> <label
					class="form-label col-xs-4 col-sm-3" >大学语文</label> 
					<input type="text" class='hidden' name="subject" value="大学语文">
					<span class="select-box span_2" style="width: 115px;">
					 <select class="select" size="1" name="knowledge">
						<option value="知识点" selected>知识点</option>
						<option value="写作">写作</option>
				</select>
				</span>
			</div>
		</div>
		<br />
		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">问卷名称:</label>
			<div class="formControls col-xs-8 col-sm-9 input_manager">
				<input class="input-text" type="text" name="scale_name">
			</div>
		</div>
		<br />
		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">问卷类型:</label>
			<div class="formControls col-xs-8 col-sm-9 input_manager">
				<span class="select-box "><select class="select" size="1"
					name="type">
						<option value="1">知识点练习</option>
						<option value="2">阶段测试</option>
						<option value="3">论述题自测</option>
						<option value="4">真题练习</option>
						<option value="5">组卷模考</option>
				</select> </span>
			</div>
		</div>
		<br />

		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">问卷介绍:</label>
			<div class="formControls col-xs-8 col-sm-9 testarea_1">
				<textarea class="textarea" name="introduction"></textarea>
			</div>
		</div>
		<br /> <br /> <br /> <br />
		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">问卷指导语:</label>
			<div class="formControls col-xs-8 col-sm-9 testarea_1">
				<input class="input-text" type="text" name="guide">
			</div>
		</div>
		<br />

		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">考试时长:</label>
			<div class="formControls col-xs-8 col-sm-9 input_manager">
				<input class="input-text" type="time" name="test_time">
			</div>
		</div>
		<br />
		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">问卷总分 :</label>
			<div class="formControls col-xs-8 col-sm-9 input_manager">
				<input class="input-text" type="text" name="total_score">
			</div>
		</div>
		<br />
		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">导入时间:</label>
			<div
				class="formControls skin-minimal col-xs-8 col-sm-9 input_manager">
				<input class="input-text" type="text" name="import_time" disabled>
			</div>
		</div>
		<br />
		<div class="row" style="margin-top: 25px;">
			<label class="form-label col-xs-4 col-sm-3">问卷形式</label>
			<div class="formControls col-xs-8 col-sm-9" style="width: 35%">
				<span class="select-box span_2" style="width: 115px;"> <select
					class="select" name="form">
						<option value=1 selected>固定问卷</option>
						<option value=2>随机问卷</option>
				</select>
				</span>
			</div>
		</div>
		<br />
		<div class="row" style="margin-top: 25px;">
			<div class="formControls col-xs-4 col-sm-3">
				<input class="btn btn-primary btn_ensure1 f-r" value="设置题目"
					type="submit"> <input
					class="btn btn-primary btn_ensure1 f-r hidden" value="设置策略"
					type="button">
			</div>
		</div>

		<div class="formControls col-xs-8 col-sm-9" style="width: 35%">
			<input id="btn_upload" class="btn btn-primary btn_exit1" value="批量导入">
		</div>
	</div>
	</div>
</form>

<div id="bcg_editor" class="editor_background">
	<form class="editor_upload form form-horizontal" method="post"
		action="/ExamSystem/UploadServlet" enctype="multipart/form-data"
		onsubmit="return check();">

		<legend> 导入excel窗口 </legend>
		<div>
			<span class="btn-upload form-group"> <input id="i_path"
				class="input-text upload-url" type="text" name="uploadfile-2"
				style="width:200px" id="uploadfile-2" readonly> <a
				href="javascript:void();" class="btn btn-primary upload-btn"><i
					class="Hui-iconfont">&#xe642;</i> 浏览文件</a> <input type="file" multiple
				name="file-2" class="input-file">
			</span>

			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input id="btn_ensure" class="btn btn-primary f-l btn_ensure"
					style="width: 75px;" value="确认" readonly type="submit"> <input
					id="btn_exit" class="btn btn-primary f-l btn_exit" value="取消"
					readonly>
			</div>
		</div>
	</form>
</div>

<script type="text/javascript">
	$('[name="scaleForm"]').change(function() {
		if ($(this).val() == 1) {
			$('.btn_ensure1').eq(0).removeClass('hidden');
			$('.btn_ensure1').eq(1).addClass('hidden');
		}
		if ($(this).val() == 2) {
			$('.btn_ensure1').eq(1).removeClass('hidden');
			$('.btn_ensure1').eq(0).addClass('hidden');
		}
	});

	$(function() {
		$('#btn_upload').on('click', function() {
			$('#bcg_editor').show();
		});

	});

	//编辑窗口取消按钮
	$(function() {
		$('#btn_exit').on('click', function() {
			$("#i_path").val("");
			$("#bcg_editor").hide();
		});

	});

	//编辑窗口确认按钮
	$(function() {
		$('#btn_ensure').on('click', function() {
		});
	});
	
	function check() {
		var path = $("#i_path").val();
		var suffix = path.substr(path.indexOf(".") + 1);
		if (suffix != "xls" && suffix != "xlsx") {
			alert("导入文件格式非法");
			return false;
		}
		return true;
	}
</script>
</html>
